home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 476-500 / disk_499 / diglib / diglib.lzh / source / SELDEV.for < prev    next >
Text File  |  1991-05-22  |  905b  |  34 lines

  1.         SUBROUTINE SELDEV(LUN)
  2.     IMPLICIT NONE
  3.     INTEGER LUN,IDEV,I,IERR
  4.     REAL*4 L
  5.         CHARACTER*1 BNAME(40)
  6. C
  7. C       Show the device numbers and their names and ask for
  8. C       a device number. Attempt to select that device. If
  9. C       not successful, display an error message and ask for
  10. C       a new device number.
  11. C
  12.         EXTERNAL LEN
  13.     INTEGER LEN
  14. C
  15. C       Display device numbers and names.
  16. C
  17.         IDEV = 1
  18. 1       CALL GSDNAM(IDEV,BNAME)
  19.         L = LEN(BNAME)
  20.         IF (L .EQ. 0) GO TO 5
  21.         WRITE(9,1111) IDEV, (BNAME(I), I=1,L)
  22. 1111    FORMAT(' Device ',I2,' is ',40A1,/)
  23.         IDEV = IDEV + 1
  24.         GO TO 1
  25. 5       WRITE(9,'(A\)') ' Number of the graphics device to use? '
  26.         READ(9,'(I5)') IDEV
  27. 6       CALL DEVSEL(IDEV,LUN,IERR)
  28.         IF (IERR .EQ. 0) GO TO 10
  29.         TYPE *, ' THAT DEVICE DOES NOT EXIST'
  30.         GO TO 5
  31. 10      Continue
  32.         Return
  33.         END
  34.